package com.xujiang.mytool.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.xujiang.common_adapter.base.IBaseAdapter;
import com.xujiang.common_adapter.core.RecyclerViewHelper;
import com.xujiang.mytool.R;
import com.xujiang.mytool.adapter.MainDeviceListAdapter;
import com.xujiang.mytool.model.DirAndFileName;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    RecyclerViewHelper mRecyclerViewHelper;
    private MainDeviceListAdapter mainDeviceListAdapter;

    @BindView(R.id.ek_ca_list_recycler_view)
    RecyclerView fileList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        mRecyclerViewHelper = RecyclerViewHelper.newBuilder(this)
                .enableHorizontalDividerLineResId(R.color.divider_line)  //开启水平下划线，并设置颜色
                .setOnItemLongClickListener(new IBaseAdapter.OnItemLongClickListener<DirAndFileName>(){  //设置item长按监听
                    @Override
                    public boolean onItemLongClick(DirAndFileName item, View view, int position) {
                        return false;
                    }
                }).setRefreshListener(new RecyclerViewHelper.RefreshListener(){  //设置下拉刷新

                    @Override
                    public void onRefresh() {

                    }
                })
                .setAdapter(mainDeviceListAdapter).build();

    }

    @OnClick(R.id.ek_ca_list_recycler_view)
    public void onViewClicked() {

    }
}
